import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/Home/FHome.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
   
    {
      path: "/login",
      name: "login",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Login.vue"),
    },
    {
      path: "/publiclist",
      name: "publiclist",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/List/PublicCourseList.vue"),
    },
    {
      path: "/setpass",
      name: "setpass",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/SetPass.vue"),
    },
    {
      path: "/setting",
      name: "setting",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Mine/Setting.vue"),
    },
    {
      path: "/detail",
      name: "detail",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/CourseDetail.vue"),
    },
    {
      path: "/search",
      name: "search",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Search/Search.vue"),
    },
    {
      path: "/searchlist",
      name: "searchlist",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Search/SearchList.vue"),
    },
    {
      path: "/seecourse",
      name: "seecourse",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/List/SeeingCourse.vue"),
    },
    {
      path: "/coursechart",
      name: "coursechart",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/List/CourseChart.vue"),
    },
    {
      path: "/collect",
      name: "collect",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/List/Collect.vue"),
    },
    {
      path: "/studyrecord",
      name: "studyrecord",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/List/StudyReconed.vue"),
    },
    {
      path: "/studyinfo",
      name: "studyinfo",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/List/StudyInfo.vue"),
    },
    {
      path: "/order",
      name: "order",
      component: () => import("../views/My/Order.vue"),
    },
    {
      path: "/vip",
      name: "vip",
      component: () => import("../views/My/Vip.vue"),
    },
    {
      path: "/discountcoupon",
      name: "discountcoupon",
      component: () => import("../views/My/DiscountCoupon.vue"),
    },
    {
      path: "/information",
      name: "information",
      component: () => import("../views/My/Information.vue"),
    },
    {
      path: "/coursenotice",
      name: "coursenotice",
      component: () => import("../views/My/CourseNotice.vue"),
    },
    {
      path: "/messagenotification",
      name: "messagenotification",
      component: () => import("../views/My/MessageNotification.vue"),
    },
    {
      path: "/orderinform",
      name: "orderinform",
      component: () => import("../views/My/OrderInform.vue"),
    },
    {
      path: "/problemfeedback",
      name: "problemfeedback",
      component: () => import("../views/My/ProblemFeedback.vue"),
    },
    {
      path: "/learncard",
      name: "learncard",
      component: () => import("../views/My/LearnCard.vue"),
    },
    {
      path: "/exchange",
      name: "exchange",
      component: () => import("../views/My/Exchange.vue"),
    },
    {
      path: "/address",
      name: "address",
      component: () => import("../views/My/Address.vue"),
    },
    {
      path: "/newaddress",
      name: "newaddress",
      component: () => import("../views/My/NewAddress.vue"),
    },
    {
      path: "/index",
      name: "index",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Index.vue"),
      children:[
        {
          path: "/cathome",
          name: "cathome",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/Home/CatHome.vue"),
        },
        {
          path: "/mclass",
          name: "mclass",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/Home/MClass.vue"),
        },
        {
          path: "/",
          name: "home",
          component: HomeView,
        },
        {
          path: "/tools",
          name: "tools",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/Home/Tools.vue"),
        },
        {
          path: "/mine",
          name: "mine",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/Home/Mine.vue"),
        }
      ] 
    }
  ],
});

export default router;
